home *** CD-ROM | disk | FTP | other *** search
- { PUSH.PAS
- By Bela Lubkin 71016,1573
- Compile this to a .COM file and put PUSH.COM somewhere on your PATH. Then
- PUSH will save the current directory in a file, and you can return to that
- directory with the POP command.
- Requires Turbo 3.0 or greater, DOS 2.0 or greater.
- }
-
- Const
- StackFileName='C:\CDSTACK.DAT'; { Change to whatever seems appropriate }
-
- Type
- StackElement=String[66];
-
- Var
- S: StackElement;
- StackFile: File Of StackElement;
- I: Integer;
-
- Begin
- Assign(StackFile,StackFileName);
- {$I-} Reset(StackFile); {$I+}
- If IOResult<>0 Then
- Begin
- {$I-} Rewrite(StackFile); {$I+}
- If IOResult<>0 Then
- Begin
- WriteLn('Fatal error -- cannot open stack file');
- Halt;
- End;
- End;
- Seek(StackFile,FileSize(StackFile));
- GetDir(0,S);
- For I:=Length(S)+1 To SizeOf(S)-1 Do S[I]:=#0;
- Write(StackFile,S);
- Close(StackFile);
- End.
-
-